<?php namespace Phpcmf\Model\Editor_md; 

class Editor_md extends \Phpcmf\Model{
    public function __construct() {
        parent::__construct();
    }

    // 获取字段内容
    public function get_info($name = '') {
        if($name){
            $data = \Phpcmf\Service::M('app')->get_config("Editor_md");

            $info = $data[$name];
        }else{
            $info = \Phpcmf\Service::M('app')->get_config("Editor_md");
        }

        return $info;
    }

    // 保存数据
    public function save($data) {
        \Phpcmf\Service::M('app')->save_config("Editor_md", $data);

        return 1;
    }

    public function get_location($ip) {
        // 获取服务商数据
         $info = $this->get_info('provider');
         return \Phpcmf\Service::L($info[0]['value'], 'Apip_search')->get_location($ip);
        
    }
}